import time

from selenium.webdriver.common.by import By
from pages.basepage import Basepage
from pages.ecshopLgpages import LogingPage
from pages.myinfopage import MyinfoPage


class IndexPage(Basepage):
    dl=(By.XPATH,'//a[@href="user.php"]')
    wdzh = (By.XPATH, '//a[@href="user.php"]')

    def go_to_myInfopage(self):
        # if self.getEleTxt(self.findELe(self.dl))=='登录':
        #     pass
        # else:
        dl = self.go_to_LogingPage()
        dl.denglu()
        time.sleep(2)
        ccot=self.findELe(self.wdzh)
        self.dlchlick(ccot)
        # time.sleep(2)
        return MyinfoPage(self.d)
    def go_to_LogingPage(self):
        self.dlchlick(self.findELe(self.dl))
        dl=LogingPage(self.d)
        return dl

if __name__ == '__main__':
    vv=IndexPage()
    wdzh = vv.go_to_myInfopage()

    ly=wdzh.clickwdly()
    vl = ly.liuyan()
